<?php
/**
 * JE Career package
 * @author J-Extension <contact@jextn.com>
 * @link http://www.jextn.com
 * @copyright (C) 2012 - 2013 J-Extension
 * @license GNU/GPL, see LICENSE.php for full license.
**/

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access');
$path	  = JURI::root();
?>
<form action="index.php" method="post" name="adminForm">
<table>
<tr>
	 <td align="left" width="100%">
		<?php echo JText::_( 'JE_FILTER' ); ?>:
		<input type="text" name="search" id="search" value="<?php echo $this->lists['search'];?>" class="text_area" onchange="document.adminForm.submit();" />
		<button onclick="this.form.submit();"><?php echo JText::_( 'JE_CAREER_GO' ); ?></button>
		<button onclick="document.getElementById('search').value='';this.form.getElementById('filter_state').value='';this.form.getElementById('posi').value='';this.form.getElementById('catidf').value='';this.form.submit();"><?php echo JText::_( 'JE_FILTERRESET' ); ?></button>
	</td>
	<td nowrap="nowrap">
		<?php
		 echo JHTML::_('select.genericlist', $this->position, 'posi', 'class="input_text" onchange="this.form.submit();"', 'value', 'text',$this->lists['posi'])
		?>
	</td>
	<td nowrap="nowrap">
		<?php
		 echo JHTML::_('select.genericlist', $this->category, 'catidf', 'class="input_text" onchange="this.form.submit();"', 'value', 'text',$this->lists['catidf'])
		?>
	</td>
</tr>
</table>
<table class="adminlist">
<thead>
	<tr>
		<th width="1%">
			<?php echo JText::_( 'JE_SER_NO' ); ?>
		</th>
		<th width="2%">
			<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count( $this->items ); ?>);" />
		</th>

		<th width="10%" nowrap="nowrap">
			<?php echo JHTML::_('grid.sort',  JText::_( 'JE_FULL_NAME' ), 's.fullname', @$this->lists['order_Dir'], @$this->lists['order'] ); ?>
		</th>
		<th width="10%" nowrap="nowrap">
			<?php echo JHTML::_('grid.sort',  JText::_( 'JE_EMAIL' ), 's.email', @$this->lists['order_Dir'], @$this->lists['order'] ); ?>
		</th>
		<th width="10%" nowrap="nowrap">
			<?php echo JHTML::_('grid.sort',  JText::_( 'JE_MOBILE' ), 's.mobile', @$this->lists['order_Dir'], @$this->lists['order'] ); ?>
		</th>
		<th width="10%" nowrap="nowrap">
				<?php echo JHTML::_('grid.sort',  JText::_( 'JE_CATEGORY' ), 'c.category', @$this->lists['order_Dir'], @$this->lists['order'] ); ?>
		</th>
		<th width="10%" nowrap="nowrap">
			<?php echo JHTML::_('grid.sort',  JText::_( 'JE_FOR_POSITION' ), 's.position', @$this->lists['order_Dir'], @$this->lists['order'] ); ?>
		</th>
		<th width="1%" nowrap="nowrap">
			<?php echo JHTML::_('grid.sort',   JText::_( 'JE_CAREER_ID' ), 's.id', @$this->lists['order_Dir'], @$this->lists['order'] ); ?>
		</th>
	</tr>
</thead>
<tfoot>
	<tr>
		<td colspan="13">
			<?php echo $this->pageNav->getListFooter(); ?>
		</td>
	</tr>
</tfoot>
<tbody>
<?php
$k 				= 0;
for ($i=0, $n=count( $this->items ); $i < $n; $i++)
{
	$row 		= &$this->items[$i];

	$checked 	= JHTML::_('grid.id',   $i, $row->id );
	$link 		= JRoute::_( 'index.php?option=com_hostingrajacareer&controller=applied_openings&task=edit&cid[]='. $row->id );
	$link1 		= JRoute::_( 'document/'.$row->resume.'' );
	if( $row->read_unread == 0) {
		$new	= " <img src=\"$path"."administrator/components/com_hostingrajacareer/assets/images/new.gif\" />";
	} else {
	   $new		= '';
	}
	?>
	<tr class="<?php echo "row$k"; ?>">
		<td>
			<?php echo $i+1; ?>
		</td>
		<td align="center">
			<?php echo $checked; ?>
		</td>

		<td align="center">
			<a href="<?php echo $link; ?>"><?php echo $row->fullname; ?></a><?php echo $new; ?>
		</td>
		<td align="center">
			<?php echo $row->email; ?>
		</td>
		<td align="center">
			<?php echo $row->mobile; ?>
		</td>
		<td align="center">
			<?php echo $row->category; ?>
		</td>
		<td align="center">
			<?php echo $row->position; ?>
		</td>
		<td align="center">
			<?php echo $row->id; ?>
		</td>
	</tr>
	<?php
	$k = 1 - $k;
}
?>
</tbody>
</table>
<input type="hidden" name="option" value="com_hostingrajacareer" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="controller" value="applied_openings" />
<input type="hidden" name="filter_order" value="<?php echo $this->lists['order']; ?>" />
<input type="hidden" name="filter_order_Dir" value="<?php echo $this->lists['order_Dir']; ?>" />
<?php echo JHTML::_( 'form.token' ); ?>
</form>
